package cn.yi.medicalsys.service.impl;

import cn.yi.medicalsys.dao.HospitalDao;
import cn.yi.medicalsys.dao.impl.HospitalDaoImpl;
import cn.yi.medicalsys.pojo.Hospital;
import cn.yi.medicalsys.service.HospitalService;

public class HospitalServiceImpl implements HospitalService {
	HospitalDao hospital=new HospitalDaoImpl();

	@Override
	public Hospital findHospitailByNo(Integer hospno) {
		Hospital hosp=null;
		try {
			hosp=hospital.findHospitalByNo(hospno);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return hosp;
	}

	@Override
	public boolean updateHospitalByNo(Hospital hosp) {
		int row=-1;
		try {
			row=hospital.updateHospitalByNo(hosp);
		} catch (Exception e) {
			e.printStackTrace();
		}
		if(row==1){
			return true;
		}
		return false;
	}
	public static void main(String[] args) {
		HospitalServiceImpl sh=new HospitalServiceImpl();
		Hospital hosp=new Hospital(10,"q","w","e","r");
		System.out.println(sh.updateHospitalByNo(hosp));
	}
	
}
